<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script>
    function request (url){
    let xhr = new XMLHttpRequest(); 
    xhr.open('GET','url',true)
    xhr.onload= function() {
      if(this.status == 200){
        var data = JSON.parse(this.responseText);
        console.log(data);
      }
    }
    xhr.send();
  }
  </script>
</head>
<body>
  
</body>
</html>